import React, { Component } from 'react'

export default class News extends Component {
  state = {
    newsArr: [
      { id: 1, title: '新闻1' },
      { id: 2, title: '新闻2' },
      { id: 3, title: '新闻3' }
    ]
  }
  render() {
    const { newsArr } = this.state
    return (
      <div>
        <ul>
          {newsArr.map((news) => {
            return <li key={news.id}>{news.title}</li>
          })}
        </ul>
      </div>
    )
  }
}
